package com.annhoa.filter;

import java.util.List;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 原生过滤器配置
 * @author admin
 * 暂时 不用
 */
//@Configuration
public class FilterConfig {
    @SuppressWarnings({ "rawtypes", "unchecked" })
	@Bean
    public FilterRegistrationBean filterRegist() {
        FilterRegistrationBean frBean = new FilterRegistrationBean();
        frBean.setFilter(new ServletFilter());
        frBean.addUrlPatterns("/*");
        return frBean;
    }
    
    //注册JWT过滤器
//        final FilterRegistrationBean registrationBean = new FilterRegistrationBean();
//        registrationBean.setFilter(new JwtFilter());
//        //添加需要拦截的url
//        List<String>  urlPatterns = Lists.newArrayList();  //此写???????????
//        urlPatterns.add("/article/insert");
//        registrationBean.addUrlPatterns(urlPatterns.toArray(new String[urlPatterns.size()]));
//        return registrationBean;
    
    
}
  